package com.tencent.welink.api.space.alarm;

import com.alibaba.fastjson.JSONArray;
import com.tencent.welink.api.OpenApiTokenChange;
import com.tencent.welink.api.base.WelinkOpenApi;
import com.tencent.welink.config.BussinessConfig;
import com.tencent.welink.util.CrontabUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

/**
 * @Description: 6. 批量获取告警图片信息
 * @Author: limye
 * @CreateDate: 2020-6-15
 * @Version: V1.0
 */
public class GetImageByIds extends WelinkOpenApi {

    private static final Logger log = LogManager.getLogger(GetImageByIds.class);

    public GetImageByIds(){
        super("/space/datahub/alarm/v0.1/getImageByIds",false);
    }


    @Override
    public void displayResult(String result) {
    }


    public static void main(String[] args) {
        new BussinessConfig();
        CrontabUtil.addTaskInRate(new OpenApiTokenChange(), BussinessConfig.loginDurationMinutes,true);

        //实例化对象
        GetImageByIds instance = new GetImageByIds();

        /**
         * body: ArrayList 类似[“warningId1”,”warningId2”]
         */
        //添加参数
        JSONArray jsonArray = new JSONArray();
        jsonArray.add("warningId1");
        jsonArray.add("warningId2");
        instance.getBodyPara().put("",jsonArray.toJSONString());

        //执行HTTP请求及展示结果
        instance.DoHttp();
        CrontabUtil.shutdown();

    }
}
